let lastInArray = <T>(arr: T[])=>{
  return arr[arr.length-1];
}

const l1 = lastInArray([1,2,3,4]);
const l2 = lastInArray<string>(["a","b","c"]);
const l3 = lastInArray<string | number>(["a","b","c"]);

let makeTube = <T,Y>(x: T, y: Y) => [x, y]

const v1 = makeTube(1,"one");
const v2 = makeTube(true, 1);